import $http from '../request';

const URL_PREFIX = "/feature"

export const $FeatureApi = {

	/**
	 * 保存特征分类
	 * @param param
	 * @returns {Promise<*>}
	 */
	saveCategory: (param) => {
		return $http.$post(URL_PREFIX + "/category/create", param, {});
	},

	/**
	 * 获取特征分类树数据
	 * @returns {Promise<*>}
	 */
	getCategoryTreeData: (params) => {
		return $http.$get(URL_PREFIX + "/category/getTreeData", params, {})
	},

	deleteCategory: (params) => {
		return $http.$get(URL_PREFIX + "/category/removeById", params, {})
	},

	updateCategory: (params) => {
		return $http.$post(URL_PREFIX + "/category/update", params, {});
	},


	/*****************************************************************************************/
	// 业务特征
	/*****************************************************************************************/

	/**
	 * 创建业务特征
	 * @param params
	 * @returns {Promise<*>}
	 */
	createBusiFeature: (params) => {
		return $http.$post(URL_PREFIX + "/busiFeature/create", params, {});
	},

	/**
	 * 更新业务特征
	 * @param params
	 * @returns {Promise<*>}
	 */
	updateBusiFeature: (params) => {
		return $http.$post(URL_PREFIX + "/busiFeature/update", params, {});
	},

	/**
	 * 获取业务特征树表
	 * @param params
	 * @returns {Promise<*>}
	 */
	getBusiFeatureTreeData: (params) => {
		return $http.$post(URL_PREFIX + "/busiFeature/queryTreeList", params, {})
	},

	/**
	 * 根据id删除业务特征
	 * @param params
	 * @returns {Promise<*>}
	 */
	removeBusiFeature: (params) => {
		return $http.$get(URL_PREFIX + "/busiFeature/removeById", params, {})
	},

	/**
	 *
	 * @param params
	 * @returns {Promise<*>}
	 */
	getCreateTableSql: (params) => {
		return $http.$get(URL_PREFIX + "/busiFeature/getCreateTableSql", params, {});
	},


	/**
	 *  查询业务特征扁平数据列表
	 */
	getFeatureList: (params) => {
		return $http.$post(URL_PREFIX + "/busiFeature/queryFeatureList", params, {})
	}


}




